package com.job.gaoyue.day0702;

import java.sql.Types;
import java.util.Scanner;

/**
 * @author ${高某}
 * @version 1.0
 * @since 2022-07-03 09:54:12
 */
public class first0702 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] names = {"a", "b", "c", "d", "e"};
        //length是字符串的长度
        System.out.println(names.length);
        //foreach 的遍历  for循环 ，格式类似于 普通for循环
        //for（数据类型 变量；要遍历的数组）
        //快捷键 数组。iter    iterator
        int[] arr = new int[5];
        for ( int num=0;num<=4;num++){
            System.out.println("输入下标为"+num+"位置的数据");
            arr[num]=sc.nextInt();
        }
        //遍历出arr[]
        for (int i : arr) {
            System.out.println(i);
        }
        for (String name : names) {
            System.out.println(name);
        }//分别打印每一个下标代表的内容
        names = new String[3];
        names[0] = "消息";
        names[1] = "通知";
        names[2] = "公告";
        //将names里的地址 0x998 赋值给了types
        String[] typos = names;//types和 names共同用同一个地址
        names = null;
    }
}